package edu.sctu.zhangwang;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Created by user09 on 2015/6/9.
 */
public class TimeStation {
    public void TimeStation(){
    Date date = new Date();
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
    String time1 = simpleDateFormat.format(date);
    System.out.println("进站时间：" + time1);

    Date time = null;
    try {
        time = simpleDateFormat.parse(time1);
    } catch (ParseException e) {
        e.printStackTrace();
    }

    Calendar calendar = Calendar.getInstance();
    calendar.setTime(time);
    calendar.add(calendar.MONTH,5);
    time=calendar.getTime();
    String time2 = simpleDateFormat.format(time);
    System.out.println("出站时间：" + time2);
}

    public static void main(String[] args) {
        TimeStation ipTimeStamp = new TimeStation();
        ipTimeStamp.TimeStation();
    }
}
